#include <iostream>

#include "config.h"
#include "conf/serverconf.h"
#include "conf/mysqlconf.h"

// Config<ServerConf>::ptr g_serverConf = ConfigMgr::GetInstance()->AddConfig("ServerConf",
//                                             ServerConf(), "serverconf");

int main()
{
    ConfigMgr::GetInstance()->LoadFromDir("");
    ServerConf serverConf = ConfigMgr::GetInstance()->GetConfig<ServerConf>("ServerConf")->GetValue();
    std::cout << serverConf.GetIp() << " " << serverConf.GetPort() << std::endl;
    MysqlConf mysqlConf = ConfigMgr::GetInstance()->GetConfig<MysqlConf>("MysqlConf")->GetValue();
    std::cout << mysqlConf.GetHost() << "   " << mysqlConf.GetUser() << " " 
            << mysqlConf.GetPWD() << "  " << mysqlConf.GetDBName() << std::endl; 
}